//
//  ZH_MineSexTableViewCell.m
//  WisdomStar
//
//  Created by zhangliwen on 2018/10/22.
//  Copyright © 2018年 zhangliwen. All rights reserved.
//

#import "ZH_MineSexTableViewCell.h"
@interface ZH_MineSexTableViewCell()
@property (nonatomic,weak)UILabel *leftLabel;
@property (nonatomic,weak)UIImageView *manImage;
@property (nonatomic,weak)UILabel *manLabel;
@property (nonatomic,weak)UIImageView *womanImage;
@property (nonatomic,weak)UILabel *womenLabel;
@end
@implementation ZH_MineSexTableViewCell

///创建
+(instancetype)cellWithTableView:(UITableView*)tableView
{
    static NSString *ID = @"ZH_MineSexTableViewCell";
    ZH_MineSexTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if(cell == nil){
        cell = [[ZH_MineSexTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
    }
    return cell;
}
///初始化
-(void)initDefault
{
    [self unShowClickEffect];
    self.bottomShortLineImage.hidden = NO;
}
- (void)loadSubviewConstraints{
    [self.leftLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).offset(FITSCALE(13));
        make.left.equalTo(self.contentView).offset(FITSCALE(22));
        make.bottom.equalTo(self.contentView).offset(FITSCALE(-13));
    }];
    [self.manImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView);
        make.left.equalTo(self.leftLabel.mas_right).offset(FITSCALE(30));
    }];
    [self.manLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView);
        make.left.equalTo(self.manImage.mas_right).offset(FITSCALE(6));
    }];
    [self.womanImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView);
        make.left.equalTo(self.manLabel.mas_right).offset(FITSCALE(50));
    }];
    [self.womenLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView);
        make.left.equalTo(self.womanImage.mas_right).offset(FITSCALE(6));
    }];
    
}
#pragma mark - getter,setter
- (UILabel *)leftLabel{
    if (!_leftLabel) {
        UILabel *label = [UILabel createLabelWithText:@"性别" font:kFontSize_28];
        [self.contentView addSubview:_leftLabel = label];
    }
    return _leftLabel;
}
- (UIImageView *)manImage{
    if (!_manImage) {
        UIImageView *image = [UIImageView createImageViewWithName:@"icon_sex_boy_selected"];
        [self.contentView addSubview:_manImage = image];
    }
    return _manImage;
}
- (UILabel *)manLabel{
    if (!_manLabel) {
        UILabel *label = [UILabel createLabelWithText:@"男" font:kFontSize_28];
        [self.contentView addSubview:_manLabel = label];
    }
    return _manLabel;
}
- (UIImageView *)womanImage{
    if (!_womanImage) {
        UIImageView *image = [UIImageView createImageViewWithName:@"icon_sex_girl"];
        [self.contentView addSubview:_womanImage = image];
    }
    return _womanImage;
}
- (UILabel *)womenLabel{
    if (!_womenLabel) {
        UILabel *label = [UILabel createLabelWithText:@"女" font:kFontSize_28];
        [self.contentView addSubview:_womenLabel = label];
    }
    return _womenLabel;
}
@end
